--[[local ma__chuanxin = fk.CreateSkill {
  name = "ma__chuanxin",
}

Fk:loadTranslationTable{
  ["ma__chuanxin"] = "穿心",
  [":ma__chuanxin"] = "一名角色结束阶段，你可以将一张牌当【杀】使用。若其因此进入濒死状态，本回合其不能再回复体力。",
  ["@ma__chuanxin"] = "穿心",

  ["#ma__chuanxin-invoke"] = "穿心：你可以将一张牌当【杀】使用",
}

ma__chuanxin:addEffect(fk.EventPhaseStart, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(ma__chuanxin.name) and target.phase == Player.Finish and
      not (player:isNude() and #player:getHandlyIds() == 0)
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local use = room:askToUseVirtualCard(player, {
      name = "slash",
      skill_name = ma__chuanxin.name,
      prompt = "#ma__chuanxin-invoke",
      cancelable = true,
      extra_data = {
        extraUse = true,
      },
      card_filter = {
        n = 1,
      },
      skip = true,
    })
    if use then
      event:setCostData(self, {extra_data = use})
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local use = event:getCostData(self).extra_data
    data.extra_data = data.extra_data or {}
    data.extra_data.ma__chuanxin = data.extra_data.ma__chuanxin or {}
    room:useCard(use)
  end,
})



ma__chuanxin:addEffect(fk.EnterDying, {
  can_refresh = function(self, event, target, player, data)
    if target == player then
      local e = player.room.logic:getCurrentEvent():findParent(GameEvent.CardEffect)
      if e then
        local use = e.data
        if use.extra_data and use.extra_data.ma__chuanxin and use.extra_data.ma__chuanxin[target] then
          return true
        end
      end
    end
  end,
  on_refresh = function(self, event, target, player, data)
    player.room:addPlayerMark(player, "@ma__chuanxin-turn")
  end,
})

ma__chuanxin:addEffect(fk.PreHpRecover, {
  mute = true,
  is_delay_effect = true,
  can_trigger = function (self, event, target, player, data)
    return target == player and player:getMark("@ma__chuanxin-turn") > 0
  end,
  on_use = function (self, event, target, player, data)
    data:preventRecover()
  end,
})

return chuanxin]]